class Task45:
    def run(self, array):
        array = [str(n) for n in array]
        self.quick_sort(array, 0, len(array))
        return ''.join(array)

    def compare(self, s_n1, s_n2):
        cat1 = s_n1 + s_n2
        cat2 = s_n2 + s_n1
        if cat1 < cat2:
            return -1
        elif cat1 > cat2:
            return 1
        else:
            return 0

    def quick_sort(self, array, start, end):
        if start < end:
            q = self.partition(array, start, end)
            self.quick_sort(array, start, q)
            self.quick_sort(array, q + 1, end)

    def partition(self, array, start, end):
        k = start
        x = array[k]
        array[k], array[end - 1] = array[end - 1], array[k]
        i = start - 1
        for j in range(start, end):
            if self.compare(array[j], x) < 0:
                i += 1
                array[i], array[j] = array[j], array[i]
        i += 1
        array[i], array[end - 1] = array[end - 1], array[i]
        return i
